@extends('admin.layout.main')

@section('content')
    <div class="breadcrumbs ace-save-state" id="breadcrumbs">
        <ul class="breadcrumb">
            <li>
                <i class="ace-icon fa fa-home home-icon"></i>
                <a href="#">统计数据</a>
            </li>
            <li class="active"><a href="{{ url('admin/count_deal') }}">成交统计</a></li>
        </ul><!-- /.breadcrumb -->

        <div class="nav-search" id="nav-search">
            <form class="form-search">
		<span class="input-icon">
		<input type="text" placeholder="Search ..." class="nav-search-input" id="nav-search-input" autocomplete="off" />
			<i class="ace-icon fa fa-search nav-search-icon"></i>
		</span>
            </form>
        </div><!-- /.nav-search -->
    </div>
    <div class="page-content">
        <div class="row">
            <div class="col-xs-12">
                <!-- PAGE CONTENT BEGINS -->
                <div class="row">
                    <div class="col-xs-12">
                        <div class="clearfix">
                            <div class="pull-right tableTools-container"></div>
                        </div>
                        <div class="table-header">
                            <a href="{{ url('admin/count_deal') }}">
                                <i class="menu-icon fa  orange"></i>
                                <span class="menu-text orange"> 刷新数据 </span>
                            </a>
                        </div>
                        <div>
                            <table id="dynamic-table" class="table table-striped table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th>序号</th>
                                    <th>币种</th>
                                    <th>英文</th>
                                    <th class="hidden-480">交易买入总数量</th>
                                    <th>交易买入总金额</th>
                                    <th class="hidden-480">交易卖出总数量</th>
                                    <th>交易卖出总金额</th>

                                </tr>
                                @foreach($currs as $key => $val)
                                <tr>
                                    <td>{{$val->id}}</td>
                                    <td>{{$val->name}}</td>
                                    <td>{{$val->name_en}}</td>
                                    <td>{{$val->buy_orders()->sum('num')}}</td>
                                    <td>{{$val->buy_orders()->sum('real_price')}}</td>
                                    <td>{{$val->seller_orders()->sum('num')}}</td>
                                    <td>{{$val->seller_orders()->sum('real_price')}}</td>

                                </tr>
                                @endforeach
                                </thead>

                            </table>
                        </div>
                    </div>
                </div>
                <!-- PAGE CONTENT ENDS -->
            </div><!-- /.col -->
    </div><!-- /.page-content -->
@endsection
